home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gnat1792.zip / gnat179b / t-adainc / s-poserr.ads < prev    next >
Text File  |  1994-05-19  |  5KB  |  89 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                 GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS               --
  4. --                                                                          --
  5. --                    S Y S T E M . P O S I X _ E R R O R                   --
  6. --                                                                          --
  7. --                                  S p e c                                 --
  8. --                                                                          --
  9. --                             $Revision: 1.4 $                             --
  10. --                                                                          --
  11. --           Copyright (c) 1991,1992,1993, FSU, All Rights Reserved         --
  12. --                                                                          --
  13. --  GNARL is free software; you can redistribute it and/or modify it  under --
  14. --  terms  of  the  GNU  Library General Public License as published by the --
  15. --  Free Software Foundation; either version 2,  or (at  your  option)  any --
  16. --  later  version.   GNARL is distributed in the hope that it will be use- --
  17. --  ful, but but WITHOUT ANY WARRANTY; without even the implied warranty of --
  18. --  MERCHANTABILITY  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Gen- --
  19. --  eral Library Public License for more details.  You should have received --
  20. --  a  copy of the GNU Library General Public License along with GNARL; see --
  21. --  file COPYING. If not, write to the Free Software Foundation,  675  Mass --
  22. --  Ave, Cambridge, MA 02139, USA.                                          --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. --  This package contains those parts of the package POSIX defined in P1003.5
  27. --  (Ada binding to POSIX.1) needed to interface to Pthreads.
  28.  
  29. with System.POSIX_Constants;
  30. package System.POSIX_Error is
  31.  
  32.    type Return_Code is new Integer;
  33.  
  34.    Failure : constant Return_Code := -1;
  35.  
  36.    type Error_Code is new Integer;
  37.  
  38.    subtype EC is Error_Code;
  39.    --  Synonym used only in this package
  40.  
  41.    function Get_Error_Code return Error_Code;
  42.    pragma Import (C, Get_Error_Code, "get_errno");
  43.    --  An interface to the error number of the current thread.  This is updated
  44.    --  by Pthreads at each context switch.
  45.  
  46.    POSIX_Error : exception;
  47.  
  48.    --  Error number definitions.  These definitions are derived from
  49.    --  /usr/include/errno.h and /usr/include/sys/errno.h. These are SunOS
  50.    --  errors; they have not yet been checked for POSIX complience.
  51.  
  52.    --  Error number definitions.
  53.    Operation_Not_Permitted : constant Error_Code := POSIX_Constants.EPERM;
  54.    No_Such_File_Or_Directory : constant Error_Code := POSIX_Constants.ENOENT;
  55.    No_Such_Process : constant Error_Code := POSIX_Constants.ESRCH;
  56.    Interrupted_Operation : constant Error_Code := POSIX_Constants.EINTR;
  57.    Input_Output_Error : constant Error_Code := POSIX_Constants.EIO;
  58.    No_Such_Device_Or_Address : constant Error_Code := POSIX_Constants.ENXIO;
  59.    Argument_List_Too_Long : constant Error_Code := POSIX_Constants.E2BIG;
  60.    Exec_Format_Error : constant Error_Code := POSIX_Constants.ENOEXEC;
  61.    Bad_File_Descriptor : constant Error_Code := POSIX_Constants.EBADF;
  62.    No_Child_Process : constant Error_Code := POSIX_Constants.ECHILD;
  63.    Resource_Temporarily_Unavailable : constant Error_Code :=
  64.          POSIX_Constants.EAGAIN;
  65.    Not_Enough_Space : constant Error_Code := POSIX_Constants.ENOMEM;
  66.    Permission_Denied : constant Error_Code := POSIX_Constants.EACCES;
  67.    Resource_Busy : constant Error_Code := POSIX_Constants.EFAULT;
  68.    File_Exists : constant Error_Code := POSIX_Constants.ENOTBLK;
  69.    Improper_Link : constant Error_Code := POSIX_Constants.EBUSY;
  70.    No_Such_Operation_On_Device : constant Error_Code := POSIX_Constants.EEXIST;
  71.    Not_A_Directory : constant Error_Code := POSIX_Constants.EXDEV;
  72.    Is_A_Directory : constant Error_Code := POSIX_Constants.ENODEV;
  73.    Invalid_Argument : constant Error_Code := POSIX_Constants.ENOTDIR;
  74.    Too_Many_Open_Files_In_System : constant Error_Code :=
  75.          POSIX_Constants.EISDIR;
  76.    To_Many_Open_Files : constant Error_Code := POSIX_Constants.EINVAL;
  77.    Inappropriate_IO_Control_Operation : constant Error_Code :=
  78.          POSIX_Constants.ENFILE;
  79.    File_Too_Large : constant Error_Code := POSIX_Constants.EMFILE;
  80.    No_Space_Left_On_Device : constant Error_Code := POSIX_Constants.ENOTTY;
  81.    Invalid_Seek : constant Error_Code := POSIX_Constants.ETXTBSY;
  82.    Read_Only_File_System : constant Error_Code := POSIX_Constants.EFBIG;
  83.    Too_Many_Links : constant Error_Code := POSIX_Constants.ENOSPC;
  84.    Broken_Pipe : constant Error_Code := POSIX_Constants.ESPIPE;
  85.    Operation_Not_Implemented : constant Error_Code := POSIX_Constants.ENOSYS;
  86.    Operation_Not_Supported : constant Error_Code := POSIX_Constants.ENOTSUP;
  87.  
  88. end System.POSIX_Error;
  89.